<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>ClosureUtils (Apache Commons Collections 4.0 API)</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ClosureUtils (Apache Commons Collections 4.0 API)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ClosureUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/collections4/CollectionUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/collections4/ClosureUtils.html" target="_top">Frames</a></li>
<li><a href="ClosureUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.apache.commons.collections4</div>
<h2 title="Class ClosureUtils" class="title">Class ClosureUtils</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.apache.commons.collections4.ClosureUtils</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <span class="strong">ClosureUtils</span>
extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><code>ClosureUtils</code> provides reference implementations and utilities
 for the Closure functor interface. The supplied closures are:
 <ul>
 <li>Invoker - invokes a method on the input object
 <li>For - repeatedly calls a closure for a fixed number of times
 <li>While - repeatedly calls a closure while a predicate is true
 <li>DoWhile - repeatedly calls a closure while a predicate is true
 <li>Chained - chains two or more closures together
 <li>Switch - calls one closure based on one or more predicates
 <li>SwitchMap - calls one closure looked up from a Map
 <li>Transformer - wraps a Transformer as a Closure
 <li>NOP - does nothing
 <li>Exception - always throws an exception
 </ul>
 All the supplied closures are Serializable.</div>
<dl><dt><span class="strong">Since:</span></dt>
  <dd>3.0</dd>
<dt><span class="strong">Version:</span></dt>
  <dd>$Id: ClosureUtils.java 1479126 2013-05-04 15:16:07Z tn $</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#asClosure(org.apache.commons.collections4.Transformer)">asClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Transformer.html" title="interface in org.apache.commons.collections4">Transformer</a>&lt;? super E,?&gt;&nbsp;transformer)</code>
<div class="block">Creates a Closure that calls a Transformer each time it is called.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#chainedClosure(org.apache.commons.collections4.Closure...)">chainedClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;...&nbsp;closures)</code>
<div class="block">Create a new Closure that calls each closure in turn, passing the
 result into the next closure.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#chainedClosure(java.util.Collection)">chainedClosure</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;closures)</code>
<div class="block">Create a new Closure that calls each closure in turn, passing the
 result into the next closure.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#doWhileClosure(org.apache.commons.collections4.Closure, org.apache.commons.collections4.Predicate)">doWhileClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure,
              <a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate)</code>
<div class="block">Creates a Closure that will call the closure once and then repeatedly
 until the predicate returns false.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#exceptionClosure()">exceptionClosure</a></strong>()</code>
<div class="block">Gets a Closure that always throws an exception.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#forClosure(int, org.apache.commons.collections4.Closure)">forClosure</a></strong>(int&nbsp;count,
          <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure)</code>
<div class="block">Creates a Closure that will call the closure <code>count</code> times.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#ifClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure)">ifClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
         <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;trueClosure)</code>
<div class="block">Create a new Closure that calls another closure based on the
 result of the specified predicate.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#ifClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure, org.apache.commons.collections4.Closure)">ifClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
         <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;trueClosure,
         <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;falseClosure)</code>
<div class="block">Create a new Closure that calls one of two closures depending
 on the specified predicate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#invokerClosure(java.lang.String)">invokerClosure</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;methodName)</code>
<div class="block">Creates a Closure that will invoke a specific method on the closure's
 input object by reflection.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#invokerClosure(java.lang.String, java.lang.Class[], java.lang.Object[])">invokerClosure</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;methodName,
              <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;[]&nbsp;paramTypes,
              <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;args)</code>
<div class="block">Creates a Closure that will invoke a specific method on the closure's
 input object by reflection.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#nopClosure()">nopClosure</a></strong>()</code>
<div class="block">Gets a Closure that will do nothing.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#switchClosure(java.util.Map)">switchClosure</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;E&gt;,<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;predicatesAndClosures)</code>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#switchClosure(org.apache.commons.collections4.Predicate[], org.apache.commons.collections4.Closure[])">switchClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;[]&nbsp;predicates,
             <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;[]&nbsp;closures)</code>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#switchClosure(org.apache.commons.collections4.Predicate[], org.apache.commons.collections4.Closure[], org.apache.commons.collections4.Closure)">switchClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;[]&nbsp;predicates,
             <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;[]&nbsp;closures,
             <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;defaultClosure)</code>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#switchMapClosure(java.util.Map)">switchMapClosure</a></strong>(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;? extends E,<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;objectsAndClosures)</code>
<div class="block">Create a new Closure that uses the input object as a key to find the
 closure to call.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static &lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../../org/apache/commons/collections4/ClosureUtils.html#whileClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure)">whileClosure</a></strong>(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
            <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure)</code>
<div class="block">Creates a Closure that will call the closure repeatedly until the
 predicate returns false.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="exceptionClosure()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>exceptionClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;exceptionClosure()</pre>
<div class="block">Gets a Closure that always throws an exception.
 This could be useful during testing as a placeholder.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd>
<dt><span class="strong">Returns:</span></dt><dd>the closure</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/ExceptionClosure.html" title="class in org.apache.commons.collections4.functors"><code>ExceptionClosure</code></a></dd></dl>
</li>
</ul>
<a name="nopClosure()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nopClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;nopClosure()</pre>
<div class="block">Gets a Closure that will do nothing.
 This could be useful during testing as a placeholder.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd>
<dt><span class="strong">Returns:</span></dt><dd>the closure</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/NOPClosure.html" title="class in org.apache.commons.collections4.functors"><code>NOPClosure</code></a></dd></dl>
</li>
</ul>
<a name="asClosure(org.apache.commons.collections4.Transformer)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>asClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;asClosure(<a href="../../../../org/apache/commons/collections4/Transformer.html" title="interface in org.apache.commons.collections4">Transformer</a>&lt;? super E,?&gt;&nbsp;transformer)</pre>
<div class="block">Creates a Closure that calls a Transformer each time it is called.
 The transformer will be called using the closure's input object.
 The transformer's result will be ignored.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>transformer</code> - the transformer to run each time in the closure, null means nop</dd>
<dt><span class="strong">Returns:</span></dt><dd>the closure</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/TransformerClosure.html" title="class in org.apache.commons.collections4.functors"><code>TransformerClosure</code></a></dd></dl>
</li>
</ul>
<a name="forClosure(int, org.apache.commons.collections4.Closure)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>forClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;forClosure(int&nbsp;count,
                        <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure)</pre>
<div class="block">Creates a Closure that will call the closure <code>count</code> times.
 <p>
 A null closure or zero count returns the <code>NOPClosure</code>.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>count</code> - the number of times to loop</dd><dd><code>closure</code> - the closure to call repeatedly</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>for</code> closure</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/ForClosure.html" title="class in org.apache.commons.collections4.functors"><code>ForClosure</code></a></dd></dl>
</li>
</ul>
<a name="whileClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>whileClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;whileClosure(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
                          <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure)</pre>
<div class="block">Creates a Closure that will call the closure repeatedly until the
 predicate returns false.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - the predicate to use as an end of loop test, not null</dd><dd><code>closure</code> - the closure to call repeatedly, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>while</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if either argument is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/WhileClosure.html" title="class in org.apache.commons.collections4.functors"><code>WhileClosure</code></a></dd></dl>
</li>
</ul>
<a name="doWhileClosure(org.apache.commons.collections4.Closure, org.apache.commons.collections4.Predicate)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doWhileClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;doWhileClosure(<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;closure,
                            <a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate)</pre>
<div class="block">Creates a Closure that will call the closure once and then repeatedly
 until the predicate returns false.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>closure</code> - the closure to call repeatedly, not null</dd><dd><code>predicate</code> - the predicate to use as an end of loop test, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>do-while</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if either argument is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/WhileClosure.html" title="class in org.apache.commons.collections4.functors"><code>WhileClosure</code></a></dd></dl>
</li>
</ul>
<a name="invokerClosure(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invokerClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;invokerClosure(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;methodName)</pre>
<div class="block">Creates a Closure that will invoke a specific method on the closure's
 input object by reflection.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>methodName</code> - the name of the method</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>invoker</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the method name is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/InvokerTransformer.html" title="class in org.apache.commons.collections4.functors"><code>InvokerTransformer</code></a>, 
<a href="../../../../org/apache/commons/collections4/functors/TransformerClosure.html" title="class in org.apache.commons.collections4.functors"><code>TransformerClosure</code></a></dd></dl>
</li>
</ul>
<a name="invokerClosure(java.lang.String, java.lang.Class[], java.lang.Object[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invokerClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;invokerClosure(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;methodName,
                            <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;?&gt;[]&nbsp;paramTypes,
                            <a href="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>[]&nbsp;args)</pre>
<div class="block">Creates a Closure that will invoke a specific method on the closure's
 input object by reflection.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>methodName</code> - the name of the method</dd><dd><code>paramTypes</code> - the parameter types</dd><dd><code>args</code> - the arguments</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>invoker</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the method name is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the paramTypes and args don't match</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/InvokerTransformer.html" title="class in org.apache.commons.collections4.functors"><code>InvokerTransformer</code></a>, 
<a href="../../../../org/apache/commons/collections4/functors/TransformerClosure.html" title="class in org.apache.commons.collections4.functors"><code>TransformerClosure</code></a></dd></dl>
</li>
</ul>
<a name="chainedClosure(org.apache.commons.collections4.Closure...)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chainedClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;chainedClosure(<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;...&nbsp;closures)</pre>
<div class="block">Create a new Closure that calls each closure in turn, passing the
 result into the next closure.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>closures</code> - an array of closures to chain</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>chained</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the closures array is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any closure in the array is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/ChainedClosure.html" title="class in org.apache.commons.collections4.functors"><code>ChainedClosure</code></a></dd></dl>
</li>
</ul>
<a name="chainedClosure(java.util.Collection)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>chainedClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;chainedClosure(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;closures)</pre>
<div class="block">Create a new Closure that calls each closure in turn, passing the
 result into the next closure. The ordering is that of the iterator()
 method on the collection.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>closures</code> - a collection of closures to chain</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>chained</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the closures collection is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the closures collection is empty</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any closure in the collection is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/ChainedClosure.html" title="class in org.apache.commons.collections4.functors"><code>ChainedClosure</code></a></dd></dl>
</li>
</ul>
<a name="ifClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ifClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;ifClosure(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
                       <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;trueClosure)</pre>
<div class="block">Create a new Closure that calls another closure based on the
 result of the specified predicate.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - the validating predicate</dd><dd><code>trueClosure</code> - the closure called if the predicate is true</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>if</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the predicate is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the closure is null</dd><dt><span class="strong">Since:</span></dt>
  <dd>3.2</dd>
<dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/IfClosure.html" title="class in org.apache.commons.collections4.functors"><code>IfClosure</code></a></dd></dl>
</li>
</ul>
<a name="ifClosure(org.apache.commons.collections4.Predicate, org.apache.commons.collections4.Closure, org.apache.commons.collections4.Closure)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>ifClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;ifClosure(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;&nbsp;predicate,
                       <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;trueClosure,
                       <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;falseClosure)</pre>
<div class="block">Create a new Closure that calls one of two closures depending
 on the specified predicate.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicate</code> - the predicate to switch on</dd><dd><code>trueClosure</code> - the closure called if the predicate is true</dd><dd><code>falseClosure</code> - the closure called if the predicate is false</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>switch</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the predicate is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if either closure is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/IfClosure.html" title="class in org.apache.commons.collections4.functors"><code>IfClosure</code></a></dd></dl>
</li>
</ul>
<a name="switchClosure(org.apache.commons.collections4.Predicate[], org.apache.commons.collections4.Closure[])">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>switchClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;switchClosure(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;[]&nbsp;predicates,
                           <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;[]&nbsp;closures)</pre>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.
 <p>
 The closure at array location 0 is called if the predicate at array
 location 0 returned true. Each predicate is evaluated
 until one returns true.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicates</code> - an array of predicates to check, not null</dd><dd><code>closures</code> - an array of closures to call, not null</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>switch</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the either array is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any element in the arrays is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the arrays are different sizes</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/SwitchClosure.html" title="class in org.apache.commons.collections4.functors"><code>SwitchClosure</code></a></dd></dl>
</li>
</ul>
<a name="switchClosure(org.apache.commons.collections4.Predicate[], org.apache.commons.collections4.Closure[], org.apache.commons.collections4.Closure)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>switchClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;switchClosure(<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;? super E&gt;[]&nbsp;predicates,
                           <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;[]&nbsp;closures,
                           <a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;? super E&gt;&nbsp;defaultClosure)</pre>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.
 <p>
 The closure at array location 0 is called if the predicate at array
 location 0 returned true. Each predicate is evaluated
 until one returns true. If no predicates evaluate to true, the default
 closure is called.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicates</code> - an array of predicates to check, not null</dd><dd><code>closures</code> - an array of closures to call, not null</dd><dd><code>defaultClosure</code> - the default to call if no predicate matches</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>switch</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the either array is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any element in the arrays is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the arrays are different sizes</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/SwitchClosure.html" title="class in org.apache.commons.collections4.functors"><code>SwitchClosure</code></a></dd></dl>
</li>
</ul>
<a name="switchClosure(java.util.Map)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>switchClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;switchClosure(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../../../org/apache/commons/collections4/Predicate.html" title="interface in org.apache.commons.collections4">Predicate</a>&lt;E&gt;,<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;predicatesAndClosures)</pre>
<div class="block">Create a new Closure that calls one of the closures depending
 on the predicates.
 <p>
 The Map consists of Predicate keys and Closure values. A closure
 is called if its matching predicate returns true. Each predicate is evaluated
 until one returns true. If no predicates evaluate to true, the default
 closure is called. The default closure is set in the map with a
 null key. The ordering is that of the iterator() method on the entryset
 collection of the map.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>predicatesAndClosures</code> - a map of predicates to closures</dd>
<dt><span class="strong">Returns:</span></dt><dd>the <code>switch</code> closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the map is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the map is empty</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any closure in the map is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the map elements are of the wrong type</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/SwitchClosure.html" title="class in org.apache.commons.collections4.functors"><code>SwitchClosure</code></a></dd></dl>
</li>
</ul>
<a name="switchMapClosure(java.util.Map)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>switchMapClosure</h4>
<pre>public static&nbsp;&lt;E&gt;&nbsp;<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&nbsp;switchMapClosure(<a href="http://download.oracle.com/javase/6/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;? extends E,<a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4">Closure</a>&lt;E&gt;&gt;&nbsp;objectsAndClosures)</pre>
<div class="block">Create a new Closure that uses the input object as a key to find the
 closure to call.
 <p>
 The Map consists of object keys and Closure values. A closure
 is called if the input object equals the key. If there is no match, the
 default closure is called. The default closure is set in the map
 using a null key.</div>
<dl><dt><span class="strong">Type Parameters:</span></dt><dd><code>E</code> - the type that the closure acts on</dd><dt><span class="strong">Parameters:</span></dt><dd><code>objectsAndClosures</code> - a map of objects to closures</dd>
<dt><span class="strong">Returns:</span></dt><dd>the closure</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the map is null</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if the map is empty</dd>
<dd><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if any closure in the map is null</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../../org/apache/commons/collections4/functors/SwitchClosure.html" title="class in org.apache.commons.collections4.functors"><code>SwitchClosure</code></a></dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ClosureUtils.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/apache/commons/collections4/Closure.html" title="interface in org.apache.commons.collections4"><span class="strong">Prev Class</span></a></li>
<li><a href="../../../../org/apache/commons/collections4/CollectionUtils.html" title="class in org.apache.commons.collections4"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/commons/collections4/ClosureUtils.html" target="_top">Frames</a></li>
<li><a href="ClosureUtils.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2001&#x2013;2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</body>
</html>
